#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/wait.h>

void handler(int signo)
{
  printf("get %d\n", signo);
  int ret = 0;
  while((ret = waitpid(-1, NULL, WNOHANG)) > 0){
    printf("wait child %d success\n", ret);
  }
}

int main()
{
  //signal(17, handler);
  signal(17, SIG_IGN);
  if(fork() == 0){
    printf("child is runing ,begin dead! pid: %d\n\n", getpid());
    sleep(3);
    exit(1);
  }
  while(1);
  return 0;
}
